﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Business;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            //Thread thForClearQ = new Thread(new ThreadStart(Test));
            //thForClearQ.Start();

            //Console.WriteLine("请输入：");
            //int str = int.Parse(Console.ReadLine());
            //for (int i = 0; i < str; i++)
            //{
            //    ParameterizedThreadStart threadStart = new ParameterizedThreadStart(Test);
            //    Thread thread = new Thread(threadStart);
            //    thread.Start("小明:" + i);
            //}
            //Console.WriteLine("请输入：");
            //int str2 = int.Parse(Console.ReadLine());
            //for (int i = 0; i < str2; i++)
            //{
            //    ParameterizedThreadStart threadStart = new ParameterizedThreadStart(Test);
            //    Thread thread = new Thread(threadStart);
            //    thread.Start("小明:" + i);
            //}
            int str = int.Parse(Console.ReadLine());
            Dictionary<int, string> dictionary = new Dictionary<int, string>();
            for (int i = 0; i < str; i++)
            {
                dictionary.Add(i, "-" + i);
            }
            Console.WriteLine("总数为：" + dictionary.Count);
        }

        public static void Test(object name)
        {
            for (int i = 0; i < 10; i++)
            {
                Thread.Sleep(3000);
                RequestCounter counter = RequestCounter.GetCounter(name.ToString());
                bool canAccess = counter.AddCount();
                Console.WriteLine(name + ":" + canAccess + counter.CurrentCount + ";" + RequestCounter.Counters.Count);
            }
        }
    }


}
